﻿using System;
using System.Runtime.Serialization;

namespace LeanEngine.Business.Security
{
    /// <summary>
    /// Represents an attempt to access an application method using a token invalid.
    /// </summary>
    [Serializable]
    public sealed class InvalidTokenException : System.Exception
    {
        /// <summary>
        /// Initializes a new instance of LeanEngine.Business.Security.InvalidTokenException class.
        /// </summary>
        /// <param name="message">The error message that explains the reson for the exception.</param>
        /// <param name="innerException">The exception is cause of the current exception.</param>
        public InvalidTokenException(string message, System.Exception innerException)
            : base(message, innerException)
        {
        }

        /// <summary>
        /// Initializes a new instance of LeanEngine.Business.Security.InvalidTokenException class.
        /// </summary>
        /// <param name="message">The error message that explains the reson for the exception.</param>
        public InvalidTokenException(string message)
            : base(message)
        {
        }
        
        /// <summary>
        /// Initializes a new instance of LeanEngine.Business.Security.InvalidTokenException class.
        /// </summary>
        public InvalidTokenException()
        {
        }

        /// <summary>
        /// Initialize a new instance of LeanEngine.Business.Security.InvalidTokenException class.
        /// </summary>
        /// <param name="info">The object that holds the serialized 
        /// data about the exception being thrown.</param>
        /// <param name="context">The object that contains contextual 
        /// information about the source or destination.</param>
        private InvalidTokenException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
    }
}
